package com.sunpy.niohttp.model;

/**
 * http协议响应对象模型
 */

import java.util.HashMap;
import java.util.Map;

/**
 * HTTP/1.1 200 OK\r\n
 * Server: Apache-Coyote/1.1\r\n
 * Set-Cookie: SHAREJSESSIONID=8a0e17c5-379f-4fc1-85e0-81eb6056f480; Path=/; HttpOnly\r\n
 * Set-Cookie: rememberMe=deleteMe; Path=/mch; Max-Age=0; Expires=Thu, 17-Jan-2019 08:18:45 GMT\r\n
 * Content-Type: application/json;charset=UTF-8\r\n
 * Content-Length: 16\r\n
 * Date: Fri, 18 Jan 2019 08:18:45 GMT\r\n
 * \r\n
 * HTTP response 1/2
 * [Time since request: 0.052455000 seconds]
 * [Request in frame: 397]
 * [Next request in frame: 402]
 * [Next response in frame: 448]
 * File Data: 16 bytes
 */
public class SunpyResponse {

    /**
     * http协议版本号
     */
    private String version;

    /**
     * 响应码
     */
    private String code;

    /**
     * 短语信息
     */
    private String status;

    /**
     * 响应头
     */
    private Map<String, String> headers = new HashMap<String, String>();

    /**
     * 响应体
     */
    private Object body;

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Map<String, String> getHeaders() {
        return headers;
    }

    public void setHeaders(Map<String, String> headers) {
        this.headers = headers;
    }

    public Object getBody() {
        return body;
    }

    public void setBody(Object body) {
        this.body = body;
    }

    @Override
    public String toString() {
        return "SunpyResponse{" +
                "version='" + version + '\'' +
                ", code='" + code + '\'' +
                ", status='" + status + '\'' +
                ", headers=" + headers +
                ", body=" + body +
                '}';
    }
}
